local skill = fk.CreateSkill{
  name = "tea__zhujing_other&",
}
local U = require "packages/utility/utility"
---@type ViewAsSkillSpec
local zhujing_other = {
  mute = true,
  interaction = function(self, player)
    local all_names = {player:getTableMark("tea__zhujing_trans")[2]}
    local names = player:getViewAsCardNames("tea__zhujing_other&", all_names, player:getCardIds("h"))
    if #names > 0 then
      return UI.CardNameBox { choices = names, all_choices = all_names }
    end
  end,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).trueName == player:getTableMark("tea__zhujing_trans")[1]
  end,
  view_as = function(self, player, cards)
    if not self.interaction.data or #cards ~= 1 then return end
    local card = Fk:cloneCard(self.interaction.data)
    card:addSubcards(cards)
    card.skillName = "tea__zhujing"
    return card
  end,
  before_use = function (self, player, use)
    local room = player.room
    room:notifySkillInvoked(player, skill.name, "special")
    player:broadcastSkillInvoke("tea__zhujing")
  end,
  enabled_at_play = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
  end,
}
skill:addEffect("viewas", zhujing_other)
return skill